home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacGames Folder / Bolo / Milo's Brain / Milo's README < prev   
Text File  |  1993-06-09  |  7KB  |  135 lines

  1. // ****************************************************************************
  2. //
  3. // Bolo standard Autopilot Brain
  4. // (C) 1993 Stuart Cheshire <cheshire@cs.stanford.edu>
  5. // I make no claims that this is good code. It is provided solely as
  6. // simple example code to assist in writing Bolo plug-in Brain modules.
  7. // I do not have the time to tidy it up and make it elegant at all, so
  8. // if you have ever been a student of mine and lost marks for bad style,
  9. // don't even think of trying to use this code to justify claiming extra
  10. // marks. It is crap. And it uses far too many global variables.
  11. //
  12. // ****************************************************************************
  13.  
  14. // ****************************************************************************
  15. //
  16. // Bolo non-standard Autopilot Brain
  17. // Modified by Milo Sharp <fxmcs@aurora.alaska.edu>
  18. // I will make many claims that this is not good code.  It is provided
  19. // solely as an alternative to the standard brain.  I do not program in
  20. // C, so if I ever let you look at the code, you would probably cringe in
  21. // horror.  I do.  And it STILL uses far too many global variables.    
  22. //
  23. // ****************************************************************************
  24.  
  25.  
  26.     Changes I've made to the brain:
  27.     
  28.     New options:
  29.     
  30.         Roam - This used to be a part of the 'Aggressive' function.  However, I
  31.         thought it was stupid that a non-aggressive brain would just sit and rot.
  32.         To me, non-aggressiveness means you won't embroil yourself in fights - not
  33.         that you don't have any motivation.  A roaming tank will avoid fights with
  34.         other tanks and will not attack pillboxes.  Bases are still fair game, as
  35.         are builders.  (see Murderous)
  36.         
  37.         Aggressive - Due to the addition of the Roam function, this has no control
  38.         over what your tank will do UNLESS he is within sight of an enemy tank or
  39.         pillbox.  With Roam unchecked and Aggressive checked, your tank will sit
  40.         in one spot, but chase after any enemy tanks that come into view.
  41.         
  42.         Drop Only Near Bases - The standard bolo brain would just place a pillbox
  43.         whereever he picked one up.  This didn't make for a tough offense against
  44.         them - they would leave their bases unprotected and scatter pillboxes around
  45.         the map randomly.  Now, with this option checked, the brain will carry any
  46.         pillboxes it has picked up with it until it reaches a base.  Once upon a
  47.         base, the brain will place a pillbox one square behind itself.  It's still
  48.         pretty mindless, but I've seen brains build some decent forts this way -
  49.         I've stumbled upon bases with two or three pills surrounding it before.
  50.         
  51.         Murderous - The old brain took no notice of builders whatsoever.  This made
  52.         it simple to have your builder sneak up behind it and drop a pillbox, 
  53.         which would take upon itself the duty of pulverising the brain.  Now the
  54.         tank will make a concerted effort to blow the builder to smithereens.  
  55.         Unfortunately, this rarely works, as the builder generally moves much too
  56.         fast for the poor brain to catch it.  However, other brains, at least,
  57.         have the tendency to leave their builders stranded amongst some buildings 
  58.         or rivers, and this has some use if a Murderous brain happens upon a lost
  59.         builder.
  60.         
  61.     Disabled options:
  62.     
  63.         Build Fortresses - This will more or less work, but is still buggy, so I
  64.         decided to leave it out.  Anyone with some skill in ResEdit could easily
  65.         re-enable it, so here's what it does:  similar to the Place Only Near
  66.         Bases (in fact, it requires that option enabled to work), Build Forts
  67.         tries to make brains work harder at defending the bases they've worked so
  68.         hard at capturing.  When a fort-building brain captures a pillbox, they
  69.         will proceed toward any friendly base they can find immediately, whereas
  70.         a brain with only the Place near Bases option on waits until they decide 
  71.         they NEED to return to the base (which is sometimes too late).  The main
  72.         problem with this is that on occasion the brain will get stuck in a loop,
  73.         as with the case of a base surrounded by four pillboxes.  Since the tank
  74.         can't slip between them, he'll blast his way out.  Moving forward, he picks
  75.         up the defenseless pillbox.  Then, realizing he must build a fort with it,
  76.         he'll turn around, move onto the base, drop the pillbox behind himself, 
  77.         and once more be trapped.
  78.         
  79.         Repair Pillboxes - This should work, with one exception.  There is no
  80.         build mode available to brains for repairing pillboxes.  The closest is
  81.         BUILDMODE_PBOX, which requires you be carrying a pill, and if you use
  82.         that, it'll tell you "You cannot place a pillbox there".  Looks like this
  83.         feature waits on Stuart, until he implements that.
  84.         
  85.     
  86.     Making the brain a leetle bit smarter:
  87.     
  88.         I tried to modify the brain's behavior a little bit, since I found it had
  89.         some incredible moronic habits.  Here's a small list of eccentricities:
  90.         
  91.             Attacked pillboxes while in deep water on a boat
  92.             Preferred the head-on-with-guns-blazing-until-a-immense-wave-of-shells-
  93.             washed-over-the-tank,causing-instant-death method of pillbox fighting
  94.             Would wade into battle carrying a pillbox, where most real players would
  95.             be more cautious with a valuable asset like an unplaced pill
  96.             Would attack other tanks EVEN while wounded and hiding in the forest
  97.             
  98.         I've tried to fix all of these.  While still not as bright as it could be,
  99.         and far from a human opponent, it performs obviously better.  I've seen it
  100.         take two pillboxes at the start of the game without being killed.  It 
  101.         still likes the head on approach, but when there are more shells coming at
  102.         him than he has armor, he'll turn tail and run (usually) which (usually)
  103.         winds up saving his butt.  This works best if there's a base nearby he can
  104.         use to repair his armor.
  105.         
  106.         He won't attack pillboxes will in a boat, which saves him from both slow
  107.         loss of ammo and instant death.  He'll try to runaway from enemy tanks 
  108.         when he is trundling around with a pillbox, and will definitely shy away
  109.         from pillboxes.  And if he's down to his last points of armor, he develops
  110.         an affinity for the forest and avoids the open road, giving him the 
  111.         cloaking advantage that many human players are fond of.
  112.         
  113.         Still and all, I've seen my brain make its' fair share of blunders.  He's
  114.         trying to burrow his way into a wall right now.  But this is at least a
  115.         slight improvement, which makes playing with computers a bit more fun.
  116.         
  117.     About this brain:
  118.     
  119.         I did NOT write the original code for this brain.  That honor goes to Stuart
  120.         Cheshire, the author of Bolo.  I've only modified it to improve performance.
  121.         Why, you might ask, didn't I just make my own?  Well, for all Stuart's remarks
  122.         about the shoddiness of the code, it's actually pretty good.  Better than I 
  123.         would have done, since I don't understand Bolo as well as Stuart (but then,
  124.         who does?).  And the best reason of all, I don't know how to program in C.
  125.         All the programming I did came from a basic knowledge of programming (from 
  126.         Pascal experience) and looking at Stuart's code for syntax examples.
  127.         
  128.         I hope you get some use out of this brain.  I've found it to outperform both
  129.         Stuart's original Standard Autopilot and the Independent Brain 0.9, which are
  130.         the only two brains I've been able to find that will work with Bolo 0.99.1.
  131.         Let me know what you think of it, and what you would like changed about it.
  132.         
  133.         
  134.                                                         Milo
  135.                                                         <fxmcs@aurora.alaska.edu>